cmake_minimum_required(VERSION 3.20)
project(cmake_if)

# if(1)
#     message("1 is true")
# endif()

# if(0)
#     message("0 is false")
# else()
#     message("not 0 is true")
# endif() 

# if(0)
#     message("0 is true?")
# elseif(NO)
#     message("NO is true?")
# else()
#     message("other cases")
# endif() 


# if(VAR_TEST)
#     message("var_test if not exists")
# else()
#     message(("var is exists"))
# endif()

#字符串运算符
# set(VAR_TEST TRUE)
# if(VAR_TEST)
#     message("var_test is exists")
# else()
#     message(("var is not exists"))
# endif()

# if("TURE")
#     message("string is exists111")
# elseif("ON")
#     message("string is exists222")
# endif()

#逻辑运算符
# set(VAR_NOT OFF)
# if(NOT VAR_NOT)
#     message("var_not is effect")
# endif()

# set(VAR_DEF OFF)
# if(DEFINED VAR_DEF)
# message("VAR_DEF is defined")
# else()
# message("VAR_DEF is not defined")
# endif()

# set(VAR2 234)
# if(${VAR2} EQUAL "234")
#     message("VAR2 is exists")
# endif()

# 正则表示式的判断
if("abc1234" MATCHES "[a-z]+")
    message("\"abc1234\" MATCHES \"[a-z]+\"")
endif()